package com.woniuxy.main.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.woniuxy.main.pojo.Order;
import com.woniuxy.main.pojo.Vi_or_co_le;
import com.woniuxy.main.pojo.Vi_or_stu_le;

public interface OrderMapper {

	/**
	 * 操作学员的
	 */
	//学员确认已上完课
	@Update("update `order` set isStudentCheck=#{isStudentCheck} where oid=#{oid}")
	public int confirm(Order order);

	//动态更新订单信息	//教练也用这个
	public int updateOrder(Order order);

	//动态查询Vi_ro_co_le数据总条数
	public int totalOrder(@Param("status")Integer status,@Param("sid")Integer sid);

	//动态查询当前页Vi_ro_co_le数据
	public List<Vi_or_co_le> studentOrder(Map<String, Object> map);

	//删除订单
	@Delete("delete from `order` where oid=#{oid}")
	public int deleteOrder(Order order);

	/**
	 * 操作教练的
	 */
	//动态查询Vi_ro_co_le数据总条数
	public int totalOrder_coach(@Param("status")Integer status,@Param("cid")Integer cid);

	//动态查询当前页Vi_ro_co_le数据
	public List<Vi_or_stu_le> coachOrder(Map<String, Object> map);

	//教练接受学员签约，新增一条订单信息
	@Insert("insert into `order`(createDate,sid,cid) values(#{createDate},#{sid},#{cid})")
	public int insertOrder(Order order);

}
